const getTestQuestions = () => {
	return new Promise((resolve, reject) => {
		uniCloud.callFunction({
			name: 'getTestQuestions',
			success: (data) => {
				const res = data.result.data
				if (Array.isArray(res)) {
					resolve(res);
				} else {
					reject()
				}
			},
			fail: () => {
				reject()
			}
		});
	})
}

export const getTestQuestionsByQuestionBankId = async (questionBankId) => {
	const res = await getTestQuestions()
	return res.filter(item => item.questionBankId === questionBankId)
}